package cn.tedu.ivos2.user.controller;

import cn.tedu.ivos2.base.response.JsonResult;
import cn.tedu.ivos2.user.pojo.dto.UserLoginParam;
import cn.tedu.ivos2.user.pojo.vo.UserVO;
import cn.tedu.ivos2.user.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@RequestMapping("/v1/user")
public class UserController {
    @Autowired
    UserService userService;
    @PostMapping("/login")
    public JsonResult login(@RequestBody UserLoginParam userLoginParam){
        log.debug("用户登录:{}",userLoginParam);
        UserVO login = userService.login(userLoginParam);
        return JsonResult.ok(login);
    }
}
